﻿@using Abp.Extensions
@using Abp.Web.Mvc.Extensions
@using MyCompanyName.AbpZeroTemplate.Web.Navigation
@model MyCompanyName.AbpZeroTemplate.Configuration.Host.Dto.HostSettingsEditDto
@{
    ViewBag.CurrentPageName = PageNames.App.Host.Settings;
}
@section Scripts
{
    @Html.IncludeScript("~/Areas/Mpa/Views/HostSettings/Index.js")
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("Settings")</span> <small>@L("SettingsHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">
        <button id="SaveAllSettingsButton" class="btn btn-primary blue"><i class="fa fa-floppy-o"></i> @L("SaveAll")</button>
    </div>
</div>
<div class="portlet light">
    <div class="portlet-body">

        <div id="SettingsTabPanel" class="tabbable-line">
            <ul class="nav nav-tabs ">
                <li class="active">
                    <a href="#SettingsGeneralTab" data-toggle="tab" aria-expanded="true">
                        @L("General")
                    </a>
                </li>
                <li class="">
                    <a href="#SettingsUserManagementTab" data-toggle="tab" aria-expanded="false">
                        @L("UserManagement")
                    </a>
                </li>
                <li class="">
                    <a href="#SettingsEmailSmtpTab" data-toggle="tab" aria-expanded="false">
                        @L("EmailSmtp")
                    </a>
                </li>
            </ul>

            <div class="tab-content">
                
                <div class="tab-pane active" id="SettingsGeneralTab">
                    <form id="GeneralSettingsForm">
                        <div class="form-group form-md-line-input form-md-floating-label">
                            <input class="form-control@(Model.General.WebSiteRootAddress.IsNullOrEmpty() ? "" : " edited")" type="text" name="WebSiteRootAddress" value="@Model.General.WebSiteRootAddress" required maxlength="128">
                            <label>@L("ThisWebSiteRootAddress")</label>
                            <span class="help-block">@L("ThisWebSiteRootAddress_Hint")</span>
                        </div>
                    </form>
                </div>

                <div class="tab-pane" id="SettingsUserManagementTab">
                    <form id="UserManagementSettingsForm">
                        <div class="md-checkbox-list">
                            <div class="md-checkbox">
                                <input id="Settings_IsEmailConfirmationRequiredForLogin" class="md-check" type="checkbox" name="IsEmailConfirmationRequiredForLogin" value="true" @(Model.UserManagement.IsEmailConfirmationRequiredForLogin ? "checked=\"checked\"" : "")>
                                <label for="Settings_IsEmailConfirmationRequiredForLogin">
                                    <span class="inc"></span>
                                    <span class="check"></span>
                                    <span class="box"></span>
                                    @L("EmailConfirmationRequiredForLogin")
                                </label>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="tab-pane" id="SettingsEmailSmtpTab">
                    <form id="EmailSmtpSettingsForm">
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="email" name="DefaultFromAddress" class="form-control@(Model.Email.DefaultFromAddress.IsNullOrEmpty() ? "" : " edited")" value="@Model.Email.DefaultFromAddress" maxlength="@MyCompanyName.AbpZeroTemplate.Authorization.Users.User.MaxEmailAddressLength">
                            <label>@L("DefaultFromAddress")</label>
                        </div>

                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="DefaultFromDisplayName" class="form-control@(Model.Email.DefaultFromDisplayName.IsNullOrEmpty() ? "" : " edited")" value="@Model.Email.DefaultFromDisplayName" maxlength="128">
                            <label>@L("DefaultFromDisplayName")</label>
                        </div>

                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="SmtpHost" class="form-control@(Model.Email.SmtpHost.IsNullOrEmpty() ? "" : " edited")" value="@Model.Email.SmtpHost" maxlength="64">
                            <label>@L("SmtpHost")</label>
                        </div>

                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="number" name="SmtpPort" class="form-control edited" value="@Model.Email.SmtpPort" maxlength="5">
                            <label>@L("SmtpPort")</label>
                        </div>

                        <div class="md-checkbox-list">
                            <div class="md-checkbox">
                                <input id="Settings_SmtpEnableSsl" class="md-check" type="checkbox" name="SmtpEnableSsl" value="true" @Html.Raw(Model.Email.SmtpEnableSsl ? "checked=\"checked\"" : "")>
                                <label for="Settings_SmtpEnableSsl">
                                    <span class="inc"></span>
                                    <span class="check"></span>
                                    <span class="box"></span>
                                    @L("UseSsl")
                                </label>
                            </div>
                            <div class="md-checkbox">
                                <input id="Settings_SmtpUseDefaultCredentials" class="md-check" type="checkbox" name="SmtpUseDefaultCredentials" value="true" @Html.Raw(Model.Email.SmtpUseDefaultCredentials ? "checked=\"checked\"" : "")>
                                <label for="Settings_SmtpUseDefaultCredentials">
                                    <span class="inc"></span>
                                    <span class="check"></span>
                                    <span class="box"></span>
                                    @L("UseDefaultCredentials")
                                </label>
                            </div>
                        </div>

                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="SmtpDomain" class="form-control@(Model.Email.SmtpDomain.IsNullOrEmpty() ? "" : " edited")" value="@Model.Email.SmtpDomain" maxlength="128">
                            <label>@L("DomainName")</label>
                        </div>

                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="SmtpUserName" class="form-control@(Model.Email.SmtpUserName.IsNullOrEmpty() ? "" : " edited")" value="@Model.Email.SmtpUserName" maxlength="128">
                            <label>@L("UserName")</label>
                        </div>

                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="password" name="SmtpPassword" class="form-control@(Model.Email.SmtpPassword.IsNullOrEmpty() ? "" : " edited")" value="@Model.Email.SmtpPassword" maxlength="128">
                            <label>@L("Password")</label>
                        </div>
                    </form>
                </div>

            </div>
        </div>

    </div>
</div>
